{extend name="userbase" /}
{block name="body"}
<div class="fly-panel fly-panel-user" pad20="">
    <div class="content-header mb20">
        <ul class="header-item-container">
            <li class="header-item active"><a href="javascript:;">绑定手机号</a></li>
        </ul>
    </div>
    {if condition="empty($userInfo.mobile)"}
    <form class="layui-form" action="{:request()->url()}" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">手机号码<span class="required-item">*</span></label>
            <div class="layui-input-block" style="width:350px;">
                <input type="text" id="mobile" name="mobile" lay-verify="required|phone" placeholder="可用于登录和找回账号密码" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机验证码<span class="required-item">*</span></label>
            <div class="layui-input-block" style="width:350px;">
                <input type="text" id="phoneCode" class="layui-input layui-input-inline" name="codeverify" placeholder="请输入手机验证码" lay-verify="required" maxlength="6" style="width:220px;">
                <input type="button" class="layui-btn layui-btn-primary getPhoneCode generate_code " value=" 获取验证码" style="float:right;" url="{:url('api/author/regCode')}">
            </div>
        </div>
        <div class="layui-form-item mt50">
            <div class="layui-input-block">
                <button class="layui-btn"  lay-submit="" lay-filter="*">绑定</button>
            </div>
        </div>
    </form>
    {else /}
    <div class="layui-form-item">
        <label class="layui-form-label">已绑定手机<span class="required-item">*</span></label>
        <div class="layui-input-block" style="width:350px;">
            <input type="text" value="{$userInfo.mobile}" disabled="undisabled"  class="layui-input layui-disabled">
        </div>
    </div>
    {/if}
</div>
{/block}
{block name="js"}

{/block}